package COMP;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JPanel;


class DrawFillPolygon extends JPanel{
	int[] xpos;
	int[] ypos;
	Color color = Color.black;
	DrawFillPolygon(int[] xpos,int[] ypos){
		this.xpos = xpos;
		this.ypos = ypos;
		this.setSize(550,400);
		this.setOpaque(false);
	}
	DrawFillPolygon(int[] xpos,int[] ypos,Color color){
		this(xpos,ypos);
		this.color = color;
	}
	public void paint(Graphics g){
		Graphics2D g2d = (Graphics2D)g.create();
		g2d.setColor(color);
		g2d.fillPolygon(xpos, ypos, ypos.length);
	}
}